#!/bin/bash

SHORTNAME=websitenotes

rm -rf ./build-dir
mkdir -p ./build-dir/chrome/content/$SHORTNAME
mkdir -p ./build-dir/chrome/skin/classic/$SHORTNAME
mkdir -p ./build-dir/defaults/preferences

cp ./src/content/* ./build-dir/chrome/content/$SHORTNAME/
cp ./src/skins/classic/* ./build-dir/chrome/skin/classic/$SHORTNAME/
cp ./src/install/* ./build-dir/
cp ./src/prefs/* ./build-dir/defaults/preferences/

cd ./build-dir/chrome
jar -Mcf ./$SHORTNAME.jar ./content ./skin
rm -rf ./content ./skin
cd ../

zip -r $SHORTNAME.xpi *
mv ./$SHORTNAME.xpi ..
rm -rf *
cd ..
rm -rf ./build-dir